using AltNetHispano.Vale.DataAnnotations;

namespace AltNetHispano.Vale
{
	public static class EngineExtensions
	{
		public static void RegisterDataAnnotationsConstraints<T>(this IValidator validator)
		{
			var inspector = new DataAnnotationsInspector();
			var constraints = inspector.GetConstraints<T>();
			foreach (var constraint in constraints)
			{
				validator.Register(constraint);
			}
		}
	}
}